Skip to content

Enable User Agent feature extension#4124

Merged
cheenamalhotra merged 2 commits intomainfrom
dev/cheena/enableuseragent
Apr 7, 2026
Merged

Enable User Agent feature extension#4124
cheenamalhotra merged 2 commits intomainfrom
dev/cheena/enableuseragent

Conversation

@cheenamalhotra
Copy link
Copy Markdown
Member

Removes app context switch no longer needed - feature is to be always-enabled.

@cheenamalhotra cheenamalhotra requested a review from a team as a code owner April 1, 2026 06:18
Copilot AI review requested due to automatic review settings April 1, 2026 06:18
@github-project-automation github-project-automation bot moved this to To triage in SqlClient Board Apr 1, 2026
@cheenamalhotra cheenamalhotra added this to the 7.1.0-preview1 milestone Apr 1, 2026
@cheenamalhotra cheenamalhotra added the Hotfix Candidate 🚑 Issues/PRs that are candidate for backporting to earlier supported versions. label Apr 1, 2026
@cheenamalhotra cheenamalhotra moved this from To triage to In review in SqlClient Board Apr 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the EnableUserAgent AppContext switch and makes the UserAgent TDS feature extension always included when feature extensions are requested, aligning the driver behavior with always-on UserAgent support.

Changes:

  • Remove LocalAppContextSwitches.EnableUserAgent and related test helper plumbing.
  • Always write the UserAgent feature extension request in TdsParser when requestedFeatures includes UserAgent.
  • Update simulated server unit tests to stop toggling the removed switch.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/ConnectionTests.cs Removes per-test switch toggling for UserAgent feature extension.
src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft/Data/SqlClient/LocalAppContextSwitchesTest.cs Drops the default-value assertion for the removed switch.
src/Microsoft.Data.SqlClient/tests/Common/LocalAppContextSwitchesHelper.cs Removes reflection-based support for capturing/restoring the removed switch.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParser.cs Removes the AppContext gate so UserAgent request is written whenever requested.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/LocalAppContextSwitches.cs Deletes the EnableUserAgent switch definition, cache field, and accessor.

@cheenamalhotra cheenamalhotra added Hotfix 7.0.1 When this PR merges, automatically open a PR to cherry-pick to the 7.0.1 branch and removed Hotfix Candidate 🚑 Issues/PRs that are candidate for backporting to earlier supported versions. labels Apr 1, 2026
@ErikEJ
Copy link
Copy Markdown
Contributor

ErikEJ commented Apr 1, 2026

Is this info avaliable on the Azure SQL side and if so, how?

@github-project-automation github-project-automation bot moved this from In review to In progress in SqlClient Board Apr 1, 2026
@paulmedynski paulmedynski self-assigned this Apr 1, 2026
@paulmedynski paulmedynski moved this from In progress to In review in SqlClient Board Apr 6, 2026
@paulmedynski
Copy link
Copy Markdown
Contributor

Is this info avaliable on the Azure SQL side and if so, how?

@ErikEJ - AFAIK, this information is not visible external to Microsoft at the moment.

Copilot AI review requested due to automatic review settings April 6, 2026 18:21
@paulmedynski paulmedynski force-pushed the dev/cheena/enableuseragent branch from 1a1599b to aebd3bd Compare April 6, 2026 18:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.56%. Comparing base (60d4b92) to head (cbe5a85).
⚠️ Report is 21 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (60d4b92) and HEAD (cbe5a85). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (60d4b92) HEAD (cbe5a85)
CI-SqlClient 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4124      +/-   ##
==========================================
- Coverage   73.22%   66.56%   -6.66%     
==========================================
  Files         280      274       -6     
  Lines       43000    65796   +22796     
==========================================
+ Hits        31486    43797   +12311     
- Misses      11514    21999   +10485     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 66.56% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cheenamalhotra cheenamalhotra enabled auto-merge (squash) April 7, 2026 15:36
@paulmedynski paulmedynski force-pushed the dev/cheena/enableuseragent branch from aebd3bd to cbe5a85 Compare April 7, 2026 18:09
@cheenamalhotra cheenamalhotra merged commit ea6091b into main Apr 7, 2026
299 checks passed
@cheenamalhotra cheenamalhotra deleted the dev/cheena/enableuseragent branch April 7, 2026 21:45
@github-project-automation github-project-automation bot moved this from In review to Done in SqlClient Board Apr 7, 2026
github-actions bot pushed a commit that referenced this pull request Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Hotfix 7.0.1 When this PR merges, automatically open a PR to cherry-pick to the 7.0.1 branch

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants